import Mock from 'mockjs'

const groupList = []
const tableCount = 60

for (let i = 0; i < tableCount; i++) {
  groupList.push(Mock.mock({
    'roleOrder': /[a-z][A-Z][0-9]{5,10}/,
    name: '@ctitle(3, 10)',
    describe: '@cword(5, 20)',
    nowstate: '@ctitle(3, 10)',
    rolegroup: '@ctitle(3, 10)'
  }))
}

export default [
  {
    url: '/roleGroupTd/list',
    type: 'get',
    response: (req, res) => {
      return {
        code: 0,
        msg: '请求成功',
        data: {
          groupList
          // 'pageTotal|100-1000': 1000
        }
      }
    }
  },
  {
    url: '/rolegroup/getById',
    type: 'get',
    response: (req, res) => {
      return {
        code: 0,
        msg: '操作成功',
        data: {
          groupName: '@ctitle(3, 10)',
          groupDescribe: '@cword(5, 20)'
        }
      }
    }
  },
  {
    url: '/rolegroup/save',
    type: 'post',
    response: (req, res) => {
      return {
        code: 0,
        msg: ''
      }
    }
  },
  {
    url: '/group/delete',
    type: 'get',
    response: (req, res) => {
      return {
        code: 0,
        msg: '删除成功',
        data: {
          groupList,
          'pageTotal|100-1000': 1000
        }
      }
    }
  },
  {
    url: '/searchGroup/getByName',
    type: 'get',
    response: (req, res) => {
      return {
        code: 0,
        msg: '删除成功',
        data: {
          groupList,
          'pageTotal|100-1000': 1000
        }
      }
    }
  }
]
